var UIPanel_My = (function () {
    function UIPanel_My() {
        this.panel = null;
    }

    var __proto = UIPanel_My.prototype;
    __proto.init = function () {


        this.rule = this.panel.getChild("rule");
        this.fundsDetails = this.panel.getChild("fundsDetails");
        this.binding = this.panel.getChild("binding");
        this.replace = this.panel.getChild("replace");

        this.userIcon = this.panel.getChild("Icon");
        this.name = this.panel.getChild("name");
        this.phone = this.panel.getChild("phone");
        this.time = this.panel.getChild("time");
        this.gold = this.panel.getChild("gold");

        this.btn_ZJ = this.panel.getChild("btn_ZJ");
        this.btn_BD = this.panel.getChild("btn_BD");
        this.btn_KF = this.panel.getChild("btn_KF");
        this.btn_HD = this.panel.getChild("btn_HD");
        this.btn_GZ = this.panel.getChild("btn_GZ");
        this.btn_JL = this.panel.getChild("btn_JL");
        this.btn_SY = this.panel.getChild("btn_SY");
        this.btn_MM = this.panel.getChild("btn_MM");
        var btn_back = this.panel.getChild("btn_back");

        btn_back.panel = this.panel;
        btn_back.onClick(this, this.clickBack);

        this.btn_ZJ.onClick(this, this.clickZJ);
        this.btn_BD.onClick(this, this.clickBD);
        this.btn_KF.onClick(this, this.clickKF);
        this.btn_HD.onClick(this, this.clickHD);
        this.btn_GZ.onClick(this, this.clickGZ);
        this.btn_JL.onClick(this, this.clickJL);
        this.btn_SY.onClick(this, this.clickSY);
        this.btn_MM.onClick(this, this.clickMM);

        this.setUserIcon('');
        this.setGold(999);
        this.setName('haha');
        this.setPhone('15251241241');
        this.setTime('2019-12-12 12:12:12');

        this.initRule();
        this.initFundsDetails();
        this.initBinding();
        this.initReplace();
    }
    __proto.initRule = function () {
        var btn_back = this.rule.getChild("btn_back");
        btn_back.panel = this.rule;
        btn_back.onClick(this, this.clickBack);
    }
    __proto.initFundsDetails = function () {
        var btn_back = this.fundsDetails.getChild("btn_back");
        btn_back.panel = this.fundsDetails;
        btn_back.onClick(this, this.clickBack);

    }
    __proto.initBinding = function () {
        var btn_back = this.binding.getChild("btn_back");
        btn_back.panel = this.binding;
        btn_back.onClick(this, this.clickBack);

    }
    __proto.initReplace = function () {
        var btn_back = this.replace.getChild("btn_back");
        btn_back.panel = this.replace;
        btn_back.onClick(this, this.clickBack);

    }
    __proto.clickBack = function (e) {
        var obj = e.target.$owner;
        obj.panel.visible = false;
    }

    __proto.clickZJ = function (url) {
        console.log('资金明细');
        this.fundsDetails.visible = true;
    }
    __proto.clickBD = function (url) {
        console.log('绑定银行卡');
        this.binding.visible = true;
    }
    __proto.clickKF = function (url) {
        console.log('在线客服');
    }
    __proto.clickHD = function (url) {
        console.log('活动');
    }
    __proto.clickGZ = function (url) {
        console.log('游戏规则');
        this.rule.visible = true;
    }
    __proto.clickJL = function (url) {
        console.log('下注记录');
        Laya.stage.event('showBetRecord')
    }
    __proto.clickSY = function (url) {
        console.log('游戏声音');
        if (this.btn_SY.selected) {
            console.log('开');
        } else {
            console.log('关');
        }


    }
    __proto.clickMM = function (url) {
        console.log('更换密码');
        this.replace.visible = true;
    }
    __proto.setUserIcon = function (url) {
        this.userIcon.icon = url;
    }
    __proto.setGold = function (value) {
        this.gold.text = value;
    }
    __proto.setName = function (value) {
        this.name.text = value;
    }
    __proto.setPhone = function (value) {
        this.phone.text = value;
    }
    __proto.setTime = function (value) {
        this.time.text = value;
    }

    return UIPanel_My;
})()
